
FUNCTION LCB_Speed_rToNorm_n :DINT
TITLE = 'LCB_Speed_rToNorm_n'
//
// This FUN uses the transmitted machine parameters and converts a real speed signal into a scaled 32-bit signal.
//
// Versionshistory:
// 1.0 Ersterstellung R.Enders

VERSION : '1.0'
AUTHOR  : 'Lenze'
FAMILY  : 'LCB'
NAME : 'SrToNn' // ( 8 Zeichen max.)
KNOW_HOW_PROTECT

VAR_INPUT
   rIn_r    : REAL;
END_VAR

VAR
    rTemp:REAL;
END_VAR
    
BEGIN

rTemp:=rIn_r * 10737418.24;
rTemp := LIMIT(MN:=-2147483568.0,IN:=rTemp,MX:=2147483568.0);
LCB_Speed_rToNorm_n := REAL_TO_DINT(rTemp);
        
END_FUNCTION